package rest;

import org.atmosphere.annotation.Asynchronous;

import javax.ws.rs.POST;
import javax.ws.rs.Path;
import java.util.concurrent.Callable;

/**
 * Created by alex on 15-1-20.
 */
@Path("async")
public class AsynchronousExecution {
    
    @POST
    @Asynchronous(waitForResource = false,contentType = "application/json")
    public Callable<Response> publish(final Message message){
        return new Callable<Response>() {
            @Override
            public Response call() throws Exception {
                return new Response("Asynchronous Execution",message.message);
            }
        };
    }
}
